package cn.liontalk.ChainResponsibilityPattern.factory;

import cn.liontalk.ChainResponsibilityPattern.CEO;
import cn.liontalk.ChainResponsibilityPattern.Director;
import cn.liontalk.ChainResponsibilityPattern.Manager;
import cn.liontalk.ChainResponsibilityPattern.Sales;
import cn.liontalk.ChainResponsibilityPattern.hander.PriceHandler;

/**
 * @author: 周哲
 * @package: cn.liontalk.ChainResponsibilityPattern.factory
 * @description:
 * @date: 2019/1/9 20:25
 * @version: V1.0
 */
public class PriceHandlerFactory {

    public static PriceHandler createPriceHandler() {
        PriceHandler priceHandler = new Sales();
        PriceHandler manager = new Manager();
        PriceHandler director = new Director();
        PriceHandler ceo = new CEO();

        priceHandler.setSuccessor(manager);
        manager.setSuccessor(director);
        director.setSuccessor(ceo);
        return priceHandler;
    }

}
